﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogisticsBLL;
using System.Data.SqlClient;

namespace WebLosgic
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
            
        }

     

        //protected void Button1_Click1(object sender, EventArgs e)
        //{
        //    if (count.Text == "" || pwd.Text == "")
        //    {
        //        Response.Write("<script>alert('账号或密码不能为空')</script>");

        //    }
        //    else
        //    {

        //        SqlDataReader read = LogBLL.logs(count.Text, pwd.Text);
        //        if (read.Read())
        //        {
        //            string name = read["UserName"].ToString();
        //            int Uid = Convert.ToInt32(read["UserID"]);
        //            Session["names"] = name;
        //            Session["UserIDs"] = Uid;
        //            Session["Act"] = count.Text;
        //            string Behavor = "" + name + ":登录系统";
        //            int TypeId = 1;
        //            int UserID = Uid;
        //            string Parameters = count.Text + "," + pwd.Text;
        //            string ProcName = "p_log";
        //            HttpRequest request = HttpContext.Current.Request;
        //            string result = request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        //            if (string.IsNullOrEmpty(result)) { result = request.ServerVariables["REMOTE_ADDR"]; }
        //            if (string.IsNullOrEmpty(result)) { result = request.UserHostAddress; }
        //            if (string.IsNullOrEmpty(result)) { result = "192.168.1.0"; }
        //            string IP = "192.168.01.01";

        //            int IsExcePion = 0;
        //            int a = ProcBLL.InserSys(Behavor, TypeId, UserID, Parameters, ProcName, IP, IsExcePion);
        //            if (a > 0)
        //            {
        //                Response.Redirect("index.aspx");
        //            }
        //            else
        //            {
        //                Response.Write("<script>alert('登录失败')</script>");
        //            }

        //        }
        //        else
        //        {
        //            Response.Write("<script>alert('账号或密码有错')</script>");
        //        }
        //    }
        //}
    }
}